<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>OOJS</title>
    <script src="./js/js01_oojs_01.js" async></script>
    <link rel="stylesheet" href="./style/common.css">
</head>
<body>
    <h1>构造函数与原型链</h1>
    <p class="msg"></p>
    <script>
        document.addEventListener("DOMContentLoaded",function(){
            let msg = document.querySelector(".msg");
            msg.innerHTML += Person1.prototype.constructor;
            msg.innerHTML += "<br>";
            let person1 = new Person1("张三");
            msg.innerHTML += person1.introduceSelf();
            msg.innerHTML += "<br>";

            let person2 = new Person2("李四");
            msg.innerHTML += person2.introduceSelf();
            msg.innerHTML += "<br>";
            msg.innerHTML += person2.toString();

            Person2.mySelf();
            person2.mySelf();
        });
    </script>
</body>
</html>